<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <title>PHP For Google App Engine</title>
  </head>
  <body>
	<form action="/put.php" method="POST">
		<label>名前　　：</label><input type="text" name="name" size="20"/><br>
		<label>コメント ：</label><input type="text" name="coment" size="50"/><br>
		<input type="submit" value="PUT" />
	</form>
	<table border="1">
		<th style="width:50px"></th>
		<th style="width:150px">名前</th>
		<th style="width:300px">コメント</th>
<!-- 検索結果を表示 -->
<?php
import slim3.service.ServiceFactory;

	$factory = ServiceFactory::getInstance();
	$service = $factory->getManager()->getDaoService();
	$list = $service->getMessages();

	foreach ($list as $mvo) {
?>
	<tr>
		<td><a href="/del.php?id=<?= $mvo->getKeyValue() ?>">削除</a></td>
		<td><?= $mvo->getName() ?></td>
		<td><?= $mvo->getComent() ?></td>
	<tr>
<?php
	}
?>
	</table>
  </body>
</html>